<template>
  <div class="home-contain">
    <!-- 公共区域 -->
    <keep-alive include="find">
      <router-view></router-view>
    </keep-alive>
    <!-- 底部栏 -->
    <!-- 根据路由原信息是否显示 -->
    <van-tabbar
      v-if="$route.meta.needTab"
      v-model="active"
      class="bottom-bar"
      active-color="#b8002c"
      inactive-color="#b4b4bd"
      route
    >
      <van-tabbar-item>
        <span>公司</span>
        <template #icon>
          <i class="iconfont iconicon_footbar_gs_sel"></i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/question">
        <span>刷题</span>
        <template #icon>
          <i class="iconfont iconicon_footbar_st_nor"></i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/find">
        <span>发现</span>
        <template #icon>
          <i class="iconfont iconicon_footbar_fx_sel"></i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/my">
        <span>我的</span>
        <template #icon>
          <i class="iconfont iconicon_footbar_wode_nor"></i>
        </template>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
// 导入子组件
export default {
  name: 'home',
  components: {},
  data () {
    return {
      active: 3
    }
  },
  created () {
    // console.log(this.$route.meta.needTab)
  }
}
</script>

<style lang="less" scope>
.bottom-bar {
  // margin-bottom: 20px;
  .iconfont {
    font-size: 28px;
  }
}
</style>
